<include file="Public:header"/>
<style>
	.hoh td.item-label,.hoh td.item-note{
		height:80px;line-height:80px;
	}
	.gezibg {
		padding:5px;width:168px;background:url('/Public/Admin/ecshe_img/imgbg.png');
	}
</style>

<div id="main-content">
	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
		<button class="close fixed" style="margin-top: 4px;">&times;</button>
		<div class="alert-content">警告内容</div>
	</div>
	<div id="main" class="main">
		<div class="main-title-h">
			<span class="h1-title">基本配置</span>
		</div>
		<div class="tab-wrap">
			<div class="tab-content">
				<form id="form" action="{:U('Config/edit')}" method="post" class="form-horizontal" enctype="multipart/form-data">
					<div id="tab" class="tab-pane in tab">
						<div class="form-item cf">
							<table>
<!--								<tr class="controls">
									<td class="item-label">网站名称 :</td>
									<td>
										<input type="text" class="form-control input-10x" name="web_name" value="{$data['web_name']}">
									</td>
									<td class="item-note"></td>
								</tr>
                                <tr class="controls" style="display: none;">
									<td class="item-label">英文名称 :</td>
									<td>
										<input type="text" class="form-control input-10x" name="en_web_name" value="{$data['en_web_name']}">
									</td>
									<td class="item-note"></td>
								</tr>-->
								<tr class="controls">
									<td class="item-label">网站标题 :</td>
									<td>
										<input type="text" class="form-control input-10x" name="web_title" value="{$data['web_title']}">
									</td>
									<td class="item-note"></td>
								</tr>
<!--                                <tr class="controls" style="display: none;">
									<td class="item-label">英文标题 :</td>
									<td>
										<input type="text" class="form-control input-10x" name="en_web_title" value="{$data['en_web_title']}">
									</td>
									<td class="item-note"></td>
								</tr>-->
								
								<tr class="controls">
									<td class="item-label">WAP页面标题 :</td>
									<td>
										<input type="text" class="form-control input-10x" name="wap_title" value="{$data['wap_title']}">
									</td>
									<td class="item-note"></td>
								</tr>
								
								<tr class="controls hoh">
									<td class="item-label">网站logo :</td>
									<td>
										<div id="addpicContainer" class="gezibg">
											<notempty name="data.web_logo">
												<img id="up_img" onclick="getElementById('inputfile').click()" style="cursor:pointer;max-height:62px;" title="点击添加图片" alt="点击添加图片" src="/Upload/public/{$data.web_logo}">
											<else/>
												<!--没有图片显示默认图片-->
												<img id="up_img" onclick="getElementById('inputfile').click()" style="cursor:pointer;max-height:62px;" title="点击添加图片" alt="点击添加图片" src="__PUBLIC__/Admin/images/addimg.png">
											</notempty>
											<input type="hidden" id="img" name="web_logo" value="{$data.web_logo}">
											<input type="file" id="inputfile" style="height:0;width:0;z-index: -1; position: absolute;left: 10px;top: 5px;" value=""/>
										</div>
									</td>
									<td class="item-note">168px*62px</td>
								</tr>
								<tr class="controls hoh">
									<td class="item-label">网站副logo :</td>
									<td>
										<div id="addpicContainer" class="gezibg">
											<notempty name="data.web_logo_deputy">
												<img id="up_img_deputy" onclick="getElementById('inputfile_deputy').click()" style="cursor:pointer;max-height:62px;" title="点击添加图片" alt="点击添加图片" src="/Upload/public/{$data.web_logo_deputy}">
											<else/>
												<!--没有图片显示默认图片-->
												<img id="up_img_deputy" onclick="getElementById('inputfile_deputy').click()" style="cursor:pointer;max-height:62px;" title="点击添加图片" alt="点击添加图片" src="__PUBLIC__/Admin/images/addimg.png">
											</notempty>
											<input type="hidden" id="img_deputy" name="web_logo_deputy" value="{$data.web_logo_deputy}">
											<input type="file" id="inputfile_deputy" style="height:0;width:0;z-index: -1; position: absolute;left: 10px;top: 5px;" value=""/>
										</div>
									</td>
									<td class="item-note">168px*62px</td>
								</tr>
								<tr class="controls hoh">
									<td class="item-label">网站页脚logo :</td>
									<td>
										<div id="addpicContainer" class="gezibg">
											<notempty name="data.footer_logo">
												<img id="up_img_footer" onclick="getElementById('inputfile_footer').click()" style="cursor:pointer;max-height:62px;" title="点击添加图片" alt="点击添加图片" src="/Upload/public/{$data.footer_logo}">
											<else/>
												<!--没有图片显示默认图片-->
												<img id="up_img_footer" onclick="getElementById('inputfile_footer').click()" style="cursor:pointer;max-height:62px;" title="点击添加图片" alt="点击添加图片" src="__PUBLIC__/Admin/images/addimg.png">
											</notempty>
											<input type="hidden" id="img_footer" name="footer_logo" value="{$data.footer_logo}">
											<input type="file" id="inputfile_footer" style="height:0;width:0;z-index: -1; position: absolute;left: 10px;top: 5px;" value=""/>
										</div>
									</td>
									<td class="item-note">121px*45px</td>
								</tr>
								
								<tr class="controls">
									<td class="item-label">网站关键字 :</td>
									<td>
										<textarea name="web_keywords" class="form-control input-10x" style="margin-bottom:10px;">{$data['web_keywords']}</textarea>
									</td>
									<td class="item-note"></td>
								</tr>
<!--                                <tr class="controls" style="display: none;">
									<td class="item-label">英文关键字 :</td>
									<td>
										<textarea name="en_web_keywords" class="form-control  input-10x" style="margin-bottom:10px;">{$data['en_web_keywords']}</textarea>
									</td>
									<td class="item-note"></td>
								</tr>-->

								<tr class="controls">
									<td class="item-label">网站描述 :</td>
									<td>
										<textarea name="web_description" class="form-control input-10x" style="margin-bottom:10px;">{$data['web_description']}</textarea>
									</td>
									<td class="item-note"></td>
								</tr>
<!--                                <tr class="controls" style="display: none;">
									<td class="item-label">英文描述 :</td>
									<td>
										<textarea name="en_web_description" class="form-control  input-10x" style="margin-bottom:10px;">{$data['en_web_description']}</textarea>
									</td>
									<td class="item-note"></td>
								</tr>-->

								<tr class="controls" style="border-bottom:1px dashed #d0d0d0;">
									<td class="item-label">网站页脚版权信息 :</td>
									<td>
										<input type="text" class="form-control input-10x" name="web_footer" value="{$data['web_footer']}">
									</td>
									<td class="item-note"></td>
								</tr>
								
								<tr class="controls hoh">
									<td class="item-label">帮助中心logo :</td>
									<td>
										<div id="addpicContainer" class="gezibg">
											<notempty name="data.help_logo">
												<img id="up_img_help" onclick="getElementById('inputfile_help').click()" style="cursor:pointer;max-height:62px;" title="点击添加图片" alt="点击添加图片" src="/Upload/public/{$data.help_logo}">
											<else/>
												<!--没有图片显示默认图片-->
												<img id="up_img_help" onclick="getElementById('inputfile_help').click()" style="cursor:pointer;max-height:62px;" title="点击添加图片" alt="点击添加图片" src="__PUBLIC__/Admin/images/addimg.png">
											</notempty>
											<input type="hidden" id="img_help" name="help_logo" value="{$data.help_logo}">
											<input type="file" id="inputfile_help" style="height:0;width:0;z-index: -1; position: absolute;left: 10px;top: 5px;" value=""/>
										</div>
									</td>
									<td class="item-note">168px*62px</td>
								</tr>
								
								<tr class="controls">
									<td class="item-label">帮助中心页脚版权信息 :</td>
									<td>
										<input type="text" class="form-control input-10x" name="help_footer" value="{$data['help_footer']}">
									</td>
									<td class="item-note"></td>
								</tr>
								<tr class="controls">
									<td class="item-label">帮助中心文章结尾标识 :</td>
									<td>
										<input type="text" class="form-control input-10x" name="web_identification" value="{$data['web_identification']}">
									</td>
									<td class="item-note"></td>
								</tr>
								
								<tr class="controls hoh" style="border-top:1px dashed #d0d0d0;">
									<td class="item-label">统计代码:</td>
									<td>
										<textarea name="web_cnzz" class="form-control input-10x">{$data['web_cnzz']}</textarea>
									</td>
									<td class="item-note">第三方：<a href="https://www.umeng.com" target="_blank">友盟CNZZ网站统计</a></td>
								</tr>
								<tr class="controls">
									<td class="item-label">禁止访问原因 [中文] :</td>
									<td>
										<textarea name="web_close_cause" class="form-control  input-10x" style="margin-bottom:10px;">{$data['web_close_cause']}</textarea>
									</td>
									<td class="item-note"></td>
								</tr>
								<tr class="controls">
									<td class="item-label">禁止访问原因 [英文] :</td>
									<td>
										<textarea name="web_close_cause_en" class="form-control input-10x" style="margin-bottom:10px;">{$data['web_close_cause_en']}</textarea>
									</td>
									<td class="item-note"></td>
								</tr>
								<tr class="controls">
									<td class="item-label">网站状态 :</td>
									<td>
										<select name="web_close" class="form-control  input-10x">
											<option value="1" <eq name="data['web_close']" value="1">selected</eq>>正常</option>
											<option value="0" <eq name="data['web_close']" value="0">selected</eq>>禁止访问</option>
										</select>
									</td>
									<td class="item-note"></td>
								</tr>
								
								<!-- <tr class="controls">
									<td class="item-label">备案号 :</td>
									<td>
										<input type="text" class="form-control  input-10x" name="web_icp" value="{$data['web_icp']}">
									</td>
									<td class="item-note"></td>
								</tr> -->
<!--								<tr class="controls">
									<td class="item-label">客服QQ :</td>
									<td>
										<input name="contact_qq" class="form-control  input-10x" style="margin-bottom:10px;" value="{$data['contact_qq']}"></input>
									</td>
									<td class="item-note"></td>
								</tr>
								<tr class="controls">
									<td class="item-label">客服QQ群 :</td>
									<td>
										<input name="contact_qqun" class="form-control  input-10x" style="margin-bottom:10px;" value="{$data['contact_qqun']}"></input>
									</td>
									<td class="item-note"></td>
								</tr>
								<tr class="controls">
									<td class="item-label">客服微信 :</td>
									<td>
										<input name="contact_wx" class="form-control  input-10x" style="margin-bottom:10px;" value="{$data['contact_wx']}"></input>
									</td>
									<td class="item-note"></td>
								</tr>-->
<!--								<tr class="controls">
									<td class="item-label">微信二维码 :</td>
									<td>
										<div id="addpicContainer">
											 利用multiple="multiple"属性实现添加多图功能 
											 position: absolute;left: 10px;top: 5px;只针对本用例将input隐至图片底下。
											 height:0;width:0;z-index: -1;是为了隐藏input，因为Chrome下不能使用display:none，否则无法添加文件 
											 onclick="getElementById('inputfile').click()" 点击图片时则点击添加文件按钮 
											<notempty name="data.wxcode">
												<img id="up_imgwx" onclick="getElementById('inputfilewx').click()" style="cursor:pointer;max-width:400px;" title="点击添加图片" alt="点击添加图片" src="/Upload/public/{$data.wxcode}">
												<else/>
												<img id="up_imgwx" onclick="getElementById('inputfilewx').click()" style="cursor:pointer;max-width:400px;" title="点击添加图片" alt="点击添加图片" src="__PUBLIC__/Admin/images/addimg.png">
											</notempty>
											<input type="hidden" id="imgwx" name="wxcode" value="{$data.wxcode}">
											<input type="file" id="inputfilewx" style="height:0;width:0;z-index: -1; position: absolute;left: 10px;top: 5px;" value=""/>
										</div>
									</td>
									<td class="item-note">微信二维码  400PX*400PX</td>
								</tr>-->
								<tr class="controls">
									<td class="item-label"></td>
									<td>
										<div class="form-item cf">
											<button class="btn submit-btn ajax-post" target-form="form-horizontal" id="submit" type="submit">提交</button>
											<a class="btn btn-return" href="{$Think.server.HTTP_REFERER}">返 回</a>
										</div>
									</td>
								</tr>
							</table>
						</div>
					</div>
				</form>
				<script type="text/javascript">
					//提交表单
					$('#submit').click(function () {
						$('#form').submit();
					});
				</script>
			</div>
		</div>
	</div>
</div>

<script charset="utf-8" src="__PUBLIC__/kindeditorv4/kindeditor-all-min.js"></script>
<script charset="utf-8" src="__PUBLIC__/kindeditorv4//lang/zh-CN.js"></script>
<script type="text/javascript">
	/** 主LOGO上传 **/
	$(document).ready(function () {
		//响应文件添加成功事件
		$("#inputfile").change(function () {
			
			if ({:APP_DEMO}) {
				return alert('测试站暂时不能修改！');
			}
			
			//创建FormData对象
			var data = new FormData();
			//为FormData对象添加数据
			$.each($('#inputfile')[0].files, function (i, file) {
				data.append('upload_file' + i, file);
			});

			//发送数据
			$.ajax({
				url: '/Admin/Config/image',
				type: 'POST',
				data: data,
				cache: false,
				contentType: false,		//不可缺参数
				processData: false,		//不可缺参数
				success: function (data) {
					if (data) {
						$('#up_img').attr("src", '/Upload/public/' + $.trim(data));
						$('#img').val($.trim(data));
						$('#up_img').show();
					}
				},
				error: function () {
					alert('上传出错');
					$(".loading").hide();	//加载失败移除加载图片
				}
			});

		});
	});
	
	/** 副LOGO上传 **/
	$(document).ready(function () {
		//响应文件添加成功事件
		$("#inputfile_deputy").change(function () {
			
			if ({:APP_DEMO}) {
				return alert('测试站暂时不能修改！');
			}
			
			//创建FormData对象
			var data = new FormData();
			//为FormData对象添加数据
			$.each($('#inputfile_deputy')[0].files, function (i, file) {
				data.append('upload_file' + i, file);
			});

			//发送数据
			$.ajax({
				url: '/Admin/Config/image',
				type: 'POST',
				data: data,
				cache: false,
				contentType: false,		//不可缺参数
				processData: false,		//不可缺参数
				success: function (data) {
					if (data) {
						$('#up_img_deputy').attr("src", '/Upload/public/' + $.trim(data));
						$('#img_deputy').val($.trim(data));
						$('#up_img_deputy').show();
					}
				},
				error: function () {
					alert('上传出错');
					$(".loading").hide();	//加载失败移除加载图片
				}
			});

		});
	});
	
	/** 页脚LOGO上传 **/
	$(document).ready(function () {
		//响应文件添加成功事件
		$("#inputfile_footer").change(function () {
			
			if ({:APP_DEMO}) {
				return alert('测试站暂时不能修改！');
			}
			
			//创建FormData对象
			var data = new FormData();
			//为FormData对象添加数据
			$.each($('#inputfile_footer')[0].files, function (i, file) {
				data.append('upload_file' + i, file);
			});

			//发送数据
			$.ajax({
				url: '/Admin/Config/image',
				type: 'POST',
				data: data,
				cache: false,
				contentType: false,		//不可缺参数
				processData: false,		//不可缺参数
				success: function (data) {
					if (data) {
						$('#up_img_footer').attr("src", '/Upload/public/' + $.trim(data));
						$('#img_footer').val($.trim(data));
						$('#up_img_footer').show();
					}
				},
				error: function () {
					alert('上传出错');
					$(".loading").hide();	//加载失败移除加载图片
				}
			});

		});
	});
	
	/** 帮助中心LOGO上传 **/
	$(document).ready(function () {
		//响应文件添加成功事件
		$("#inputfile_help").change(function () {
			
			if ({:APP_DEMO}) {
				return alert('测试站暂时不能修改！');
			}
			
			//创建FormData对象
			var data = new FormData();
			//为FormData对象添加数据
			$.each($('#inputfile_help')[0].files, function (i, file) {
				data.append('upload_file' + i, file);
			});

			//发送数据
			$.ajax({
				url: '/Admin/Config/image',
				type: 'POST',
				data: data,
				cache: false,
				contentType: false,		//不可缺参数
				processData: false,		//不可缺参数
				success: function (data) {
					if (data) {
						$('#up_img_help').attr("src", '/Upload/public/' + $.trim(data));
						$('#img_help').val($.trim(data));
						$('#up_img_help').show();
					}
				},
				error: function () {
					alert('上传出错');
					$(".loading").hide();	//加载失败移除加载图片
				}
			});

		});
	});
</script>

<script type="text/javascript">
    // KindEditor.ready(function(K) {
    //     window.editor = K.create('#web_reg');
    // });
	var editor;
	KindEditor.ready(function (K) {
		editor = K.create('textarea[name="web_reg"]', {
			width: '500px',
			height: '100px',
			allowImageUpload: true,
			items: [
				'source', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
				'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
				'insertunorderedlist', '|', 'emoticons', 'link', 'fullscreen'],
			afterBlur: function () {

                editor.sync();
			}
		});
		editors = K.create('textarea[name="en_web_reg"]', {
			width: '500px',
			height: '100px',
			allowPreviewEmoticons: false,
			allowImageUpload: true,
			items: [
				'source', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
				'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
				'insertunorderedlist', '|', 'emoticons', 'link', 'fullscreen'],
			afterBlur: function () {
				this.sync();
			}
		});
	});
</script>
<include file="Public:footer"/>